package com.bree.erp.entity;

import java.io.Serializable;

public class PermissionId implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private String user;
	private Long project;
	

	public PermissionId() {
		
	}
			
	public PermissionId(String user, Long project) {
		super();
		this.user = user;
		this.project = project;
	}
	
	@Override 
	public boolean equals(Object object) {
		
		if(this == object) {
			return true;
		}
		
		if(object instanceof PermissionId) {
			PermissionId that = (PermissionId) object;
			
			return this.user != null & this.project != null
					&& this.user.equals(that.user) && this.project.equals(that.project);
		}
		
		return false;
	}
	
	@Override
	public int hashCode() {
		return (user == null ? 0 : user.hashCode()) 
			+ (project == null ? 0 : project.hashCode());
	}

	/**
	 * @return the user
	 */
	public String getUser() {
		return user;
	}

	/**
	 * @return the project
	 */
	public Long getProject() {
		return project;
	}

	
}
